feat(components): support multimodal function tool results - #982
Open
shentongmartin wants to merge 2 commits into
Open
feat(components): support multimodal function tool results#982shentongmartin wants to merge 2 commits into
shentongmartin wants to merge 2 commits into
Conversation
Change-Id: I483e055f3a0a39a72ab8260c5b6740e4b3790a50
Need to create a new tagThe following modules have changes and may need version updates:
|
Change-Id: I7331e2f23005464df7ab5ee5dbc17297d763c70e
Need to create a new tagThe following modules have changes and may need version updates:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Multimodal Function Tool Results
Problem
FunctionToolResultcan represent images in Eino, but the legacy Ark Responses SDK exposesfunction_call_output.outputas a string. Image tool results therefore failed before reaching an Ark vision model.Solution
Route AgenticArk requests through
ark-runtime-gowhile retaining the existing public configuration and option types. A text-only result remains a string. A result containing an image is sent as an orderedinput_text/input_imagecontent array.Decisions
function_call_output; do not turn it into an unrelated user message.file://media inputs before the new SDK can upload local files implicitly.Key Insight
Tool output modality is part of the conversation protocol. Passing an image as a normal message loses the model's association with the originating tool call; the Responses API must receive it in that call's output item.
Summary
多模态函数工具结果
问题
Eino 的
FunctionToolResult可以表达图片,但旧 Ark Responses SDK 将function_call_output.output定义为字符串,导致图片工具结果无法传递给支持视觉能力的 Ark 模型。方案
内部请求改由
ark-runtime-go发送,同时保留现有公开配置和 option 类型。纯文本结果仍发送为字符串;包含图片的结果按顺序发送为input_text/input_image内容数组。决策
function_call_output内,不伪装成无关的 user message。file://媒体输入,避免隐式上传本地文件。json.RawMessage改写请求,保证用户文本和大整数不被破坏。关键洞察
工具输出的模态属于对话协议。将图片作为普通消息传递会丢失其与原工具调用的关联;Responses API 必须在对应工具调用的输出项中接收图片。
总结